<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#image").click(function () {
                $(this).attr("src","/image/code?r="+Math.random())
            })
        })
    </script>
</head>
<body>
<form th:action="@{/login/image}" method="post" align="center">
    用户名: <input type="text" name="username"><br>
    密码 : <input type="text" name="password"><br>
    验证码: <input type="text" name="image_code">
    <img id="image" src="/image/code"><br>
    <button>提交</button>
</form>
</body>
</html>